div
  input#url 
  input#submit type="submit" value="提交"

div
  p#image_status 请在上面输入url!
  p
    = image_tag("", id:"image_box", size: "300x120")


- content_for(:js) do
  coffee:
    $(document). ready ->
      $('#submit').click ->
        data = {'url': $('#url').val()}
        $.ajax 
          type: 'GET'
          url: '/get_image'
          data: data
          beforeSend: ->
            $('#image_status').html "载入中。。。"
          success: (data, textStatus) ->
            $('#image_status').html "载入完成"
            image_url = "/images/" + data.image_url
            $("#image_box").attr "src", image_url
          error: ->
            $('#image_status').html "有点不对劲，请重新输入地址"

